package mk.jug.academy.model;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.EnumType;
import javax.persistence.Enumerated;
import javax.persistence.Lob;

import mk.jug.academy.model.status.LecturerStatus;


/**
 * Domain model representing a {@link Lecturer} in the Java Academy.
 * One lecturer can be involved in multiple {@link Course}s. 
 * 
 * @author Ice.Penov
 */
@Entity @SuppressWarnings("serial")
public class Lecturer extends User {
	
	public static final String CODE_PREFIX = "LEC-";
	
	public Lecturer() {
		setRole(UserType.LECTURER.toString());
	}
	
	@Column(nullable = false)
	private String firstName;
	
	@Column(nullable = false)
	private String lastName;
	
	@Column(nullable = false) @Lob
	private String bio;
	
	@Column @Enumerated(EnumType.STRING)
	private LecturerStatus status;
		
	/**
	 * The code identifier of the entity. 
	 */
	public String getCode() {
		return CODE_PREFIX + getId();
	}
	
	@Override
	public String getDisplayName() {
		return firstName + " " + lastName;
	}
	
	/**
	 * Returns the bio.
	 */
	public String getBio() {
		return bio;
	}

	/**
	 * Setter for the bio.
	 */
	public void setBio(String bio) {
		this.bio = bio;
	}

	/**
	 * Returns the status.
	 */
	public LecturerStatus getStatus() {
		return status;
	}

	/**
	 * Setter for the status.
	 */
	public void setStatus(LecturerStatus status) {
		this.status = status;
	}

	/**
	 * Returns the firstName.
	 */
	public String getFirstName() {
		return firstName;
	}

	/**
	 * Setter for the firstName.
	 */
	public void setFirstName(String firstName) {
		this.firstName = firstName;
	}

	/**
	 * Returns the lastName.
	 */
	public String getLastName() {
		return lastName;
	}

	/**
	 * Setter for the lastName.
	 */
	public void setLastName(String lastName) {
		this.lastName = lastName;
	}
	
}